<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id = "app">
       <!-- v-if和v-else的使用 -->
       <div v-if="show">
           true的时候显示
       </div>
       <div v-else>
           false的时候显示 
       </div>

       <!-- v-else-if的使用 -->
       <div v-if="score >= 90">优秀</div>
       <div v-else-if="score >= 80">良好</div>
       <div v-else-if="score >= 70">一般</div>
       <div v-else-if="score >= 60">及格</div>
       <div v-else>不及格</div>

       <!-- 上面这种写法不好，可以通过计算属性来实现判断 -->
       <h2>{{shows}}</h2>
    

    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                message: 'Hello Vue!',
                show:true,
                score:80,
            },
            computed:{
               shows(){

                let showMessage = '';
                if(this.score >= 90){
                    showMessage = '优秀'
                }else if(this.score >= 80){
                    showMessage = '良好'
                }else if(this.score >= 60){
                    showMessage = '及格'

                }else{
                    showMessage = '不及格'
                }
                return showMessage;
               }
            },
            methods:{
               
               

            }
        })

    </script>
</body>

</html>